#include <REGX52.H>
#include "LCD1602.h"
#include "DS18B20.h"

float T;

//unsigned char Ack;

void main()
{
	   LCD_Init();
	   LCD_ShowString(1,1,"Tempreratrue:");
	   //Ack=Onewire_Init();
	   //LCD_ShowNum(2,1,Ack,2);
      while(1)
     {
         DS18B20_ConverT() ;
         T=DS18B20_ReadT();
			   if(T<0)
				 {
					 LCD_ShowChar(2,1,'-');
					 T=-T;
				 }
				 else
				 {
					 LCD_ShowChar(2,1,'+');
				 }
         LCD_ShowNum(2,2,T,3);//显示整数部分
         LCD_ShowChar(2,5,'.');
         LCD_ShowNum(2,6,(unsigned long)(T*10000)%10000,4);//小数部分显示				 
     }

}
